/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lesson3.com.demo.ser;

import java.io.*;


public class DeserializeDog {
    
    public static void main(String[] args) throws IOException, ClassNotFoundException{
        Dog myDog;
       
        
        File f = new File("daisy.ser");
        FileInputStream fis = new FileInputStream(f);
        ObjectInputStream ois = new ObjectInputStream(fis);
        
        Object obj = ois.readObject();
        
        myDog = (Dog)obj;
        System.out.println("My deserialized dog : "+myDog.toString());
        
        ois.close();
        
    }

}
